package models

import (
	"gorm.io/gorm"
)

type RoleMenu struct {
	RoleId        string `json:"roleId" gorm:"type:varchar(50);comment:角色ID;primary_key"`
	MenuId        string `json:"menuId" gorm:"type:varchar(50);comment:菜单ID;primary_key"`
	DefaultStatus string `json:"defaultStatus" gorm:"default:0;type:varchar(50);comment:默认状态"`

	CRUD `json:"-" gorm:"-"`
}

func (RoleMenu) TableName() string {
	return "sys_role_menu_r"
}
func (RoleMenu) FindListByConds(db *gorm.DB, data interface{}, conds string, params ...interface{}) (err error) {
	db.Model(&RoleMenu{}).Where(conds, params...).Find(data)
	return
}
func (RoleMenu) Add(db *gorm.DB, data interface{}) (err error) {
	err = db.Model(&RoleMenu{}).Create(data).Error
	return err
}
